package linkedList;

public class Demo {
	public static void main(String[] args){
		Node node1 = new Node("刘备");
		node1.next = new Node("小强");
		node1.next.next = new Node("周星驰");
		node1.next.next.next = new Node("周星星");
		System.out.println(node1);
	}
}
class Node{
	Object value;   //表示当前节点里面的内容
	Node next;    //下一个节点的地址
	public Node(Object obj){
		this.value=obj;
	}
	//递归
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return next==null?value.toString():value.toString()+","+next;
	}
	
	
	
	
	
	
	
	
}
